//Name:
//Purpose:
//Author: wjy
//Date: 2022-01-11 21:16:56
//From:

#include <stdio.h>
#include <stdlib.h>

void transform1(int a);
void transform2(int b);

int main(void)
{
    int num;
    printf("Enter a two-digit number: ");
    scanf("%d", &num);
    printf("You entered the number ");
    if (11 <= num && num <= 19)
    {
        if (num == 11)
            printf("eleven\n");
        if (num == 12)
            printf("twelve\n");
        if (num == 13)
            printf("thirteen\n");
        if (num == 14)
            printf("fourteen\n");
        if (num == 15)
            printf("fifteen\n");
        if (num == 16)
            printf("sixteen\n");
        if (num == 17)
            printf("seventeen\n");
        if (num == 18)
            printf("eighteen\n");
        if (num == 19)
            printf("nineteen\n");
    }
    else
    {
        transform1(num / 10);
        if (num % 10 != 0)
        {
            printf("-");
            transform2(num % 10);
        }
        printf("\n");
    }
    system("pause");
    return 0;
}

void transform1(int a)
{
    switch (a)
    {
    case 2:
        printf("twenty");
        break;
    case 3:
        printf("thirty");
        break;
    case 4:
        printf("fourty");
        break;
    case 5:
        printf("fifty");
        break;
    case 6:
        printf("sixty");
        break;
    case 7:
        printf("seventy");
        break;
    case 8:
        printf("eighty");
        break;
    case 9:
        printf("ninety");
        break;
    default:
        break;
    }
}

void transform2(int b)
{
    switch (b)
    {
    case 1:
        printf("one\n");
        break;
    case 2:
        printf("two\n");
        break;
    case 3:
        printf("three\n");
        break;
    case 4:
        printf("four\n");
        break;
    case 5:
        printf("five\n");
        break;
    case 6:
        printf("six\n");
        break;
    case 7:
        printf("seven\n");
        break;
    case 8:
        printf("eight\n");
        break;
    case 9:
        printf("nine\n");
        break;
    }
}